package com.example.demo.config;

import cn.hankchan.redis.sdk.RedisDistributedLock;
import cn.hankchan.redis.sdk.config.RedisCacheSDKConfiguration;
import cn.hankchan.redis.sdk.core.RedisPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author hankChan
 *         2018/2/6 0006.
 */
@Configuration
@Import(RedisCacheSDKConfiguration.class)
public class RedisDistributedConfiguration {

    @Autowired
    RedisPool redisPool;

    @Bean
    public RedisDistributedLock redisDistributedLock() {
        return new RedisDistributedLock(redisPool);
    }
}
